package com.nuo.common.quartz.core.entity;

import com.baomidou.mybatisplus.annotation.IdType;
import com.baomidou.mybatisplus.annotation.TableField;
import com.baomidou.mybatisplus.annotation.TableId;
import com.baomidou.mybatisplus.annotation.TableName;
import lombok.AllArgsConstructor;
import lombok.Data;
import lombok.NoArgsConstructor;

import java.io.Serializable;
import java.util.Date;

/**
 * 任务日志
 * @TableName quartz_log
 */
@TableName(value ="quartz_log")
@Data
@NoArgsConstructor
@AllArgsConstructor
public class QuartzLogDO implements Serializable {

    /**
     * 任务日志id
     */
    @TableId(value = "id", type = IdType.AUTO)
    private Long id;

    /**
     * 任务id
     */
    @TableField(value = "job_id")
    private Integer jobId;

    /**
     * 任务模式 1.bean模式  2.http模式
     */
    @TableField(value = "job_mode")
    private Integer jobMode;

    /**
     * jobMode =1: 执行Bean名称,jobMode =2:调度接口地址，一般为开放接口
     */
    @TableField(value = "bean_name")
    private String beanName;

    /**
     * 执行参数，JSON字符串
     */
    @TableField(value = "params")
    private String params;

    /**
     * 任务状态：1成功，2失败
     */
    @TableField(value = "state")
    private Integer state;

    /**
     * 失败信息
     */
    @TableField(value = "error")
    private String error;

    /**
     * 耗时(单位：毫秒)
     */
    @TableField(value = "times")
    private Integer times;

    /**
     * 创建时间
     */
    @TableField(value = "create_time")
    private Date createTime;

    @TableField(exist = false)
    private static final long serialVersionUID = 1L;

}